{__NOLAYOUT__}
{include file='../public/header' /}
<div class="container-fluid bg-white h-100 table-responsive ">
    <br>
    <div class="row">
        <form class="m-auto w-75" id="content" action="{$Request.root}/{$Request.controller}/editBannerPost">
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">类型</label>
                <div class="col-sm-10">
                    <div class="form-group clearfix">
                        <div class="icheck-success d-inline">
                            <input type="radio" name="type" value="1" {$editData.type==1 ? 'checked' :''} id="ismenu">
                            <label for="ismenu">
                                轮播图
                            </label>
                        </div>
                        <div class="icheck-success d-inline">
                            <input type="radio" name="type" value="2" {$editData.type==2 ? 'checked' :''} id="notmenu">
                            <label for="notmenu">
                                友情链接
                            </label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group" class="display-none">
                <input type="hidden" name="id" value="{$editData.id}">
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">名称</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="title" value="{$editData.title}" placeholder="请输入图片名称">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">描述</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="description" value="{$editData.description}" placeholder="请输入图片描述">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">图片上传</label>
                <div class="col-sm-10">
                    <input id="img_upload" type="file" onchange="uploadImg('image_url','img_upload','preview_image','img_label')" accept="image/*" />
                    <input type="hidden" name="image_url" id="image_url" value="{$editData.image_url}">
                    <div id="preview_image">
                        <img src="{$editData.image_url ? getUrlPath($editData.image_url) :'__STATIC__/img/user3-128x128.jpg'}">
                    </div>
                    <label for="img_upload" class="btn btn-warning btn-sm mt-2" id="img_label">图片上传
                    </label>
                    <small class="form-text text-muted mb-2">轮播图推荐900X400</small>
                </div>
            </div>
            <div class="form-group row mt-4">
                <label class="col-sm-2 col-form-label">链接地址</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="link_url" value="{$editData.link_url}" placeholder="请输入链接地址">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">备注</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="remark" value="{$editData.remark}" placeholder="请输入备注[选填]">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">显示</label>
                <div class="col-sm-10">
                    <div class="form-group">
                        <div class="icheck-success d-inline">
                            <input type="checkbox" name="show_status" {$editData.show_status==1 ? 'checked' :''} id="showStatus">
                            <label for="showStatus">
                                是否可用
                            </label>
                        </div>
                    </div>
                </div>
            </div>
    </div>
    <button class="sub-bindbtn" id="{:config('app.app_debug') ? 'debug':'nodebug'}" lay-submit lay-filter="bind">
        </form>
</div>
</div>
{include file='../public/script' /}
<script src="__ADMINSTATIC__/js/validate/bannerValidate.js"></script>